package cn.stylefeng.guns.modular.system.service;

import cn.stylefeng.guns.modular.system.entity.QuestionAnswer;
import cn.stylefeng.guns.modular.system.mapper.QuestionMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 管理员表 服务实现类
 * </p>
 *
 * @author stylefeng
 * @since 2018-12-07
 */
@Service
public class QuestionService extends ServiceImpl<QuestionMapper, QuestionAnswer> {

    public Integer addQuestion(QuestionAnswer questionAnswer) {
        return this.baseMapper.insert(questionAnswer);
    }

    public QuestionAnswer selectByQuestionId(Long userId, Long id) {
        return this.baseMapper.selectByQuestionId(userId, id);
    }

    public List<Map<String, Object>> selectByUserId(Long userId) {
        return this.baseMapper.selectByUserId(userId);
    }
}
